<template>
	<view class="kupono-msg">
		<titleName :name="name"></titleName>
		<view class="title-bgc"></view>
		<view class="content-wrap">
			<uni-collapse-item title="转移联单详情" :show-animation="true" :open="false">
				<view class="transfer-detail">
					<view class="unit">产废单位：河南全会有限公司</view>
					<view class="unit">排污许可证号：78195698456378567</view>
					<view class="unit">危废类型：测试名称</view>
					<view class="unit">处置量：4kg</view>
					<view class="unit">处置联单编号：123456789012346</view>
					<view class="unit">创建时间：2024-05-01</view>
					<view class="unit">处置联单图片：<button>点击查看</button></view>
					<view class="unit">产废联系人：薛伟</view>
					<view class="unit">联系电话：12345678901</view>
					<view class="unit">车辆信息：豫a1234</view>
					<view class="unit">驾驶员：李师傅</view>
				</view>
			</uni-collapse-item>
			<view class="dispose-wrap">
				<uni-collapse-item title="处置单位" :show-animation="true" :open="false">
					<view class="transfer-detail">
						<view class="unit">处置单位：河南处置有限公司</view>
						<view class="unit">营业执照代码：12345678903457</view>
						<view class="unit">联系人：李新生</view>
						<view class="unit">联系电话：12345678901</view>
						<view class="receive-num">
							<view class="name"><text>*</text>接收量：</view>
							<view class="ipt-wrap">
								<input placeholder-class="placeholder" type="text" placeholder="请输入接收量" />
								<uni-data-select placeholder="单位" v-model="aa" :localdata="unitList"
									:clear="true"></uni-data-select>

							</view>
						</view>
						<view class="receive-cause">
							<view class="name"><text>*</text>接收原因：</view>
							<view class="ipt-wrap">
								<textarea maxlength="-1"
									placeholder-style="color:#999;font-size: 27rpx;font-weight: 400;"
									placeholder="请输入原因" />


							</view>
						</view>
					</view>
				</uni-collapse-item>
			</view>
			<view class="btn-wrap">
				<button class="save">确认签收</button>
				<button class="back">拒签</button>
			</view>
		</view>


	</view>
</template>

<script setup>
	import titleName from '../../components/titleName.vue'
	import noData from '../../components/noDataShow.vue'
	import http from '../../request/index'
	import uploadFile from '../../request/uploadFile.js'
	import {
		onShow,
		onLoad
	} from '@dcloudio/uni-app'
	import {
		reactive,
		ref
	} from 'vue'
	let adviceTypeList = ref([])
	let unitList = ref([])

	let aa = ref('')
	let dataList = ref([{}, {}, {}, {}, {}, {}, {}])
	let statusList = ref([])
	let total = ref('')
	let queryParams = reactive({})
	let id = ref('')
	let dataTree = ref()
	let showLine = ref('none')
	let change = (e) => {

		console.log(e, 'e')

	}
	let name = "联单信息"
	onLoad((e) => {



	})
	onShow(() => {
		getList()
	})
	http({
		url: "/listitem/getmodule",
		data: {
			module: 'B04'
		}
	}).then((res) => {
		if (res.code == 0) {
			unitList.value = res.data.map((item) => {
				return {
					text: item.name,
					value: item.id
				}
			})
			console.log(unitList.value, 'fsd');
		}
	})

	function mapTree(data) {
		console.log(data, 'data');
		if (data.length <= 0) return

		return data.map((item) => {
			item.text = item.regionname
			item.value = item.id
			if (item.lstSubNodes && item.lstSubNodes.length > 0) {
				item.children = item.lstSubNodes
				for (var i = 0; i < item.lstSubNodes.length; i++) {

					item.children[i].text = item.lstSubNodes[i].regionname
					item.children[i].value = item.lstSubNodes[i].id
					if (item.lstSubNodes[i].lstSubNodes && item.lstSubNodes[i].lstSubNodes.length > 0) {
						mapTree(item.lstSubNodes[i].lstSubNodes)
					}
				}
			}
			return item
		})
	}

	// let getList = () => {
	// 	http({
	// 		url: "/wasteDispose/datalist",
	// 		data: {
	// 			stockenterpriseid: id.value,
	// 			...queryParams
	// 		}
	// 	}).then((res) => {
	// 		if (res.code == 0) {
	// 			dataList.value = res.data.list
	// 			total.value = res.data.total

	// 		}
	// 	})
	// }
	let dataChange = (e) => {
		console.log(e, 'e');
		if (e.length == 0) {
			showLine.value = 'none'
			queryParams.startdate = ''
			queryParams.enddate = ''
			return
		}
		queryParams.startdate = e[0]
		queryParams.enddate = e[1]
		showLine.value = 'block'
	}
	http({
		url: '/listitem/getmodule',
		data: {
			module: 'B03'
		}
	}).then((res) => {
		if (res.code == 0) {
			let data = res.data
			adviceTypeList.value = data.map((item) => {
				return {
					text: item.name,
					value: item.id
				}
			})

		}
	})
</script>

<style lang="scss" scoped>
	:deep(.uni-date-editor--x) {
		border: none;
	}

	:deep(.uni-date__x-input) {
		font-weight: 400;
		font-size: 25rpx;
		color: #333333;
		text-align: center;
	}

	:deep(.ipt-class) {

		font-weight: 400;
		font-size: 25rpx;
		color: #666666;


	}

	:deep(.uni-select) {
		width: 131rpx;
		height: 59rpx;
	}

	:deep(.uni-stat-box) {
		width: 131rpx;
		height: 59rpx;
		background: #0066FF;
		border-radius: 7rpx;
	}

	:deep(.uni-select) {
		border: none !important;
	}

	:deep(.icon-calendar) {
		display: none;
	}

	:deep(.uni-select__input-text) {
		color: #fff !important;
	}


	:deep(.uni-icons) {
		color: #fff !important;
	}

	/* --- */
	:deep(.uni-collapse-item__title-text) {

		font-family: Source Han Sans CN;
		font-weight: bold;
		font-size: 35rpx;
		color: #333333;
		position: relative;
		padding-left: 28rpx;
	}

	:deep(.placeholder) {

		font-family: Source Han Sans CN;
		font-weight: 400 !important;
		font-size: 22rpx !important;
		color: #999999 !important;

	}

	:deep(.uni-collapse-item) {
		background-color: #fff;
	}

	:deep(.uni-collapse-item__title-text)::before {
		content: '';
		width: 8rpx;
		height: 32rpx;
		background: #0874FA;
		border-radius: 4rpx;
		position: absolute;

		left: 0;
		top: 50%;
		transform: translateY(-50%);
	}

	.kupono-msg {
		width: 100vw;
		height: 100vh;
		height: calc(100vh - 160rpx);

		.title-bgc {
			width: 750rpx;
			height: 160rpx;
			background: #0874FA;
		}

		.btn-wrap {
			display: flex;
			align-items: center;
			margin-top: 46rpx;
			padding-left: 54rpx;

			.save {
				width: 299rpx;
				height: 88rpx;
				background: #0874FA;
				border-radius: 44rpx;
				line-height: 88rpx;
				font-family: Source Han Sans CN;
				font-weight: 500;
				font-size: 31rpx;
				color: #FFFFFF;

			}

			.back {
				margin-left: 38rpx;
				width: 299rpx;
				height: 88rpx;
				background: #FF6666;
				border-radius: 44rpx;
				line-height: 88rpx;
				font-family: Source Han Sans CN;
				font-weight: 500;
				font-size: 31rpx;
				color: #FFFFFF;
				margin-left: 38rpx;
			}
		}


		.content-wrap {
			height: calc(100vh - 160rpx);
			width: 100vw;
			background-color: #F3F5F7;
			padding-top: 13rpx;
			overflow: scroll;
			padding-bottom: 50rpx;

			.dispose-wrap {
				margin-top: 16rpx;
				padding-bottom: 60rpx;

				.transfer-detail {
					.receive-cause {
						margin-top: 50rpx;
						display: flex;


						.name {
							flex-shrink: 0;
							display: flex;
							align-items: center;
							font-family: Source Han Sans CN;
							font-weight: 400;
							font-size: 31rpx;
							color: #000000;
							align-self: flex-start;

							text {
								color: #F82A24;
							}
						}

						.ipt-wrap {
							width: 491rpx;
							height: 145rpx;
							background: #FAFAFA;
							border-radius: 7rpx;
							border: 1px solid #BFBFBF;

							textarea {
								padding-right: 20rpx !important;
								padding-left: 31rpx;
								width: 491rpx;
								height: 145rpx;
								box-sizing: border-box;
							}
						}
					}

					.receive-num {
						display: flex;
						align-items: center;
						margin-top: 50rpx;

						.name {
							display: flex;
							align-items: center;
							font-family: Source Han Sans CN;
							font-weight: 400;
							font-size: 31rpx;
							color: #000000;

							text {
								color: #F82A24;
							}
						}

						.ipt-wrap {
							width: 491rpx;
							height: 59rpx;
							background: #FAFAFA;
							border-radius: 7rpx;
							border: 1px solid #BFBFBF;
							display: flex;
							align-items: center;

							input {
								height: 100%;
								width: 360rpx;
								padding-left: 30rpx;
								flex-shrink: 0;
							}
						}
					}

					.unit {

						font-family: Source Han Sans CN;
						font-weight: 400;
						font-size: 28rpx;
						color: #333333;

					}


				}
			}

			.transfer-detail {
				padding-left: 54rpx;
				padding-bottom: 60rpx;

				.unit:first-child {
					margin-top: 20rpx !important;
				}

				.unit {
					display: flex;
					align-items: center;
					font-family: Source Han Sans CN;
					font-weight: 400;
					font-size: 28rpx;
					color: #333333;
					margin-top: 33rpx;

					button {
						color: #0874FA;
						font-weight: 400;
						font-size: 28rpx;
						height: 39rpx;
						line-height: 39rpx;
					}
				}
			}
		}
	}
</style>